package com.sjc.grpc.client.service;

import com.sjc.grpc.client.grpc.GrpcClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HelloService {
    private static Logger log = LoggerFactory.getLogger(HelloService.class);

    @Autowired
    private GrpcClient grpcClient;

    public String sayHello(String userName){
        try{
            return grpcClient.getHello(userName);
        }catch (Exception e){
            log.error("sayHello {}", userName,e);
        }
        return "";
    }
}
